<!DOCTYPE html>
<html lang="en" class="no-js" xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="admin/layout">
<head>
<title>管理员管理</title>
<script th:inline="javascript">
	/*<![CDATA[*/
$(function() {
		$("#adminForm").validate({
			rules : {
				email : {
					loginName : true
					
				},
				password : {
					required : true,
					minlength : 6,
					maxlength : 20
				},
				confirm_password : {
					required : true,
					minlength : 6,
					maxlength : 20,
					equalTo : "#password"
				}
				
				
			},
			messages : {
				loginName : {
					required : '邮箱/手机号 不能为空'
				},
				password : {
					required : "请填写您的密码！",
					minlength : "密码必须是6-20位字符！",
					maxlength : "密码必须是6-20位字符！"
				},
				confirm_password : {
					required : "请填写确认密码！",
					minlength : "确认密码必须是6-20位字符！",
					maxlength : "确认密码必须是6-20位字符！",
					equalTo : "两次密码不一致"
				},
				authcode : {
					required : '验证码 不能为空',
					remote : '验证码填写不正确'
				},
				telcode : {
					required : '手机验证码 不能为空',
					remote : '手机验证码填写不正确'
				}
			}
		});
	});
	
			/*]]>*/
</script>
</head>
<body>
	<div layout:fragment="content">
		<div class="row">
			<div class="col-md-12">
				<div class="btn-group pull-right">
					<a href="index.html" th:href="@{/admin/user/user/index/}"
						id="sample_editable_1_new" class="btn green">返回<i
						class="fa fa-arrow-circle-o-left"></i></a>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<div class="form">
					<form role="form" th:action="@{/admin/admin/admin/save}" th:object="${admin}"
						id="adminForm" method="post" class="form-horizontal">
						<h4 class="form-section">管理员信息</h4>
						<input type="hidden" th:field="*{id}" />
						<div class="form-body">
							<div class="form-group"
								th:class="${#fields.hasErrors('loginName')}? 'form-group has-error' : 'form-group'">
								<label class="control-label col-md-3">用户名:<span
									class="required" aria-required="true">* </span></label>
								<div class="col-md-4">
									<input type="text" class="form-control" placeholder="用户名"
										th:field="*{loginName}" />
								</div>
							</div>
						<div class="form-group" th:class="${#fields.hasErrors('password')}? 'form-group has-error' : 'form-group'">
							<label class="control-label col-md-3">登录密码<span class="required" aria-required="true">* </span></label>							
							<div class="col-md-4">
								<input type="password" class="form-control" placeholder="登录密码" name="password" />
								<span class="help-block" th:if="${#fields.hasErrors('password')}" th:errors="*{password}">邮箱不能为空</span>
							</div>
						</div>
							<div class="form-group">
							<label class="control-label col-md-3">确认密码<span class="required" aria-required="true">* </span></label>
							<div class="col-md-4">
								<input type="password" class="form-control" placeholder="确认密码" name="confirm_password" />
								<span class="help-block"></span>
							</div>
						</div>

						</div>
						<div class="form-actions fluid">
							<div class="col-md-offset-3 col-md-9">
								<button type="submit" class="btn blue" name="sub">提交</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</body>
</html>